#ifndef _SMART_DEVICE_DATABASE_HEAD
#define _SMART_DEVICE_DATABASE_HEAD

#include <sqlite3.h>
#include <stdio.h>
#include <strings.h>
#include <string> // Include the correct header for std::string
#include <cstring>
#include <vector>

using namespace std;

typedef struct
{
	string operation;
	string deviceType;
	string deviceNumber;

} smart_device_t;

class SmartDeviceDatabase
{
public:
	static SmartDeviceDatabase *getSmartDeviceDatabase();
	bool                        addDevice(const string &operation, const string &deviceType, const string &deviceNumber);
	bool                        removeDevice(const string &operation, const string &deviceType, const string &deviceNumber);
	vector<smart_device_t>      queryDevice(bool *ok = nullptr);

private:
	sqlite3 *     pdb;
	sqlite3_stmt *add_stmt;
	sqlite3_stmt *remove_stmt;
	sqlite3_stmt *query_stmt;
	SmartDeviceDatabase();
	~SmartDeviceDatabase();
	static SmartDeviceDatabase *db;
};

#endif